package com.ruoyi.studyroom.bpm.enums;

import org.assertj.core.util.Lists;

import java.util.List;

/**
 * 生产通知单
 */
public enum ProdNoticeBusPdfTypes {

    /**
     * 待确认
     */
    Fabric_Invs("toConfirm","待接收"),


    /**
     * 已确认
     */
    Confirmed("confirmed","已接收");

    private final String  stateCode;

    private final String  desc;

    ProdNoticeBusPdfTypes(String stateCode, String desc){
        this.stateCode = stateCode;
        this.desc = desc;
    }

    // Getter 方法
    public String getStateCode() {
        return stateCode;
    }

    public String getDesc() {
        return desc;
    }

    // 根据 stateCode 获取枚举值
    public static ProdNoticeBusPdfTypes fromCode(String code) {
        for (ProdNoticeBusPdfTypes state : values()) {
            if (state.getStateCode().equals(code)) {
                return state;
            }
        }
        return null; // 或抛出异常
    }


    // 根据 stateCode 获取描述
    public static String getDescfromCode(String code) {
        for (ProdNoticeBusPdfTypes state : values()) {
            if (state.getStateCode().equals(code)) {
                return state.getDesc();
            }
        }
        return null; // 或抛出异常
    }

    public static List<String>  getAllStateCode(){
        List all = Lists.newArrayList();
        for (ProdNoticeBusPdfTypes state : values()) {
            all.add(state.getStateCode());
        }
        return  all;
    }

}
